// 表单字段配置
export const formColumns: any = [
    {
        prop: 'id',
        label: 'ID',
        isEdit: false, // 是否可编辑,组件属性是 disabled， true 为不可编辑，false 为可编辑
        isShow: false, // 是否显示，组件属性是 v-show， false 为隐藏，true 为显示
    },
    {
        prop: 'username',
        label: '用户名',
        isEdit: true,
        isShow: true,
        width: 120,
        value: '',
    },
    {
        prop: 'name',
        label: '姓名',
        isEdit: false,
        isShow: true,
        width: 120,
        value: '',
        rules: [
            {required: true, message: '请输入姓名', trigger: 'blur'},
            {min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur'},
        ],
    },
    {
        prop: 'phone',
        label: '手机号',
        isEdit: false,
        isShow: true,
        width: 120,
        value: '',
        rules: [
            {required: true, message: '请输入手机号', trigger: 'blur'},
            {type: 'string', pattern: /^1[3456789]\d{9}$/, message: '手机号码格式错误', trigger: 'blur'},
        ],
    },
    {
        prop: 'sex',
        label: '性别',
        type: 'select',
        width: 120,
        isEdit: false,
        isShow: true,
        value: '',
        options: [
            {label: '男', value: '男'},
            {label: '女', value: '女'},
            {label: '保密', value: '保密'}
        ],
    },
    {
        prop: 'age',
        label: '年龄',
        type: 'inputNumber',
        width: 120,
        isEdit: false,
        isShow: true,
        value: '',
    },
    {
        prop: 'address',
        label: '地址',
        type: 'input',
        width: 120,
        isEdit: false,
        isShow: true,
        value: '',
    },
    {
        prop: 'roleId',
        label: '角色',
        type: 'select',
        width: 120,
        isEdit: false,
        isShow: true,
        value: '',
        options: [],
    },
    {
        prop: 'email',
        label: '邮箱',
        isEdit: false,
        isShow: true,
        width: 120,
        value: '',
        rules: [
            {required: true, message: '请输入邮箱', trigger: 'blur'},
            {type: 'email', message: '邮箱格式错误', trigger: 'blur'},
        ],
    },
    {
        prop: 'createTime',
        label: '注册时间',
        type: 'time',
        isEdit: true,
        isShow: true,
        width: 120,
        value: '',
    },
    {
        prop: 'enabled',
        label: '用户状态',
        type: 'switch',
        activeText: '启用', // switch为打开时的文字
        inactiveText: '禁用', // switch为关闭时的文字
        activeValue: 1, // switch为打开时的值
        inactiveValue: 0,// switch为关闭时的值
        width: 120,
        isEdit: true,
        isShow: true,
        value: '',
    },
]